package com.example.demo.ProxyMode;

/**
 * 代练者(强制代理)
 */
public class GamePlayerProxy2 implements IGamePlayer2,IProxy{

    private IGamePlayer2 iGamePlayer;

    public GamePlayerProxy2(IGamePlayer2 iGamePlayer){
        this.iGamePlayer = iGamePlayer;
    }

    @Override
    public void login(String user, String password) {
        this.iGamePlayer.login(user,password);
    }

    @Override
    public void killBoss() {
        this.iGamePlayer.killBoss();
    }

    @Override
    public void upgrade() {
        this.iGamePlayer.upgrade();
        this.count();
    }

    @Override
    public IGamePlayer2 getProxy() {
        return this;
    }

    @Override
    public void count() {
        System.out.println("总费用150");
    }
}
